package com.framework.utils;

import com.framework.utils.jiufu.StringUtils;

/**
 * 功能描述: 校验所有密码
 *
 * @author ck
 * @date 2018/8/29 15:58
 */
public class PasswordValidate {
	/**
	 *
	 * @param password AES加密的密码
	 * @param md5 家盐值的密码
	 * @return rue : 正确
	 */
	public static boolean validate(String password,String md5){
		boolean isValidate = false;
		String textPassword = AesUtil.aesDecrypt(password);
		//校验密码是否正确
		//boolean isValidate = MD5Util.verify(textPassword,md5);
		String res = MD5Util.string2MD5(textPassword);
		if(StringUtils.equals(res,md5)){
			isValidate = true;
		}
		return isValidate;
	}

	public static void main(String[] args) {
		System.out.print(validate("3rXNR5kaeexfD2ptGXLWyg==","e25d1920589eb1d25b103f83a2712fa48f11d7140ec5991e"));
	}
}
